import request from '@/utils/request'

// 创建质检任务
export function createInspectionSchemeTask(data) {
  return request({
    url: '/quality/inspection-scheme-task/create',
    method: 'post',
    data: data
  })
}

// 质检结果录入
export function resultsInput(data) {
  return request({
    url: '/quality/inspection-scheme-task/resultsInput',
    method: 'post',
    data: data
  })
}


// 更新质检任务
export function updateInspectionSchemeTask(data) {
  return request({
    url: '/quality/inspection-scheme-task/update',
    method: 'put',
    data: data
  })
}

// 删除质检任务
export function deleteInspectionSchemeTask(id) {
  return request({
    url: '/quality/inspection-scheme-task/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除质检任务 */
export function deleteInspectionSchemeTaskList(ids) {
  return request({
    url: `/quality/inspection-scheme-task/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得质检任务
export function getInspectionSchemeTask(id) {
  return request({
    url: '/quality/inspection-scheme-task/get?id=' + id,
    method: 'get'
  })
}

// 获得质检任务分页
export function getInspectionSchemeTaskPage(params) {
  return request({
    url: '/quality/inspection-scheme-task/page',
    method: 'get',
    params
  })
}
// 导出质检任务 Excel
export function exportInspectionSchemeTaskExcel(params) {
  return request({
    url: '/quality/inspection-scheme-task/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
